<template>
    <div class="box">
        <div class="top">
            <p class="title">实时游客统计</p>
            <p class="bg"></p>
            <p class="deal">可预约总量<span>99999</span>人</p>
        </div>
        <div class="number">
            <span v-for="(item, index) in people" :key="index">{{ item }}</span>
        </div>
        <!-- echarts展示图形图表的盒子 -->
        <div class="charts" ref="charts">555</div>
    </div>
</template>
<script setup lang='ts'>
import { ref, onMounted } from 'vue';
// 引入echarts
import * as echarts from 'echarts';
// 水球图
import 'echarts-liquidfill';
// 当前人数
let people = ref('215908人');
// 获取图形图表实例
let charts = ref();
onMounted(() => {
    // 获取 echarts类的实例
    let mycharts = echarts.init(charts.value);
    // 设置实例的配置项
    mycharts.setOption({
        title: {
            text: '水球图',
        },
        // x|y轴组件
        xAxis: {
        },
        yAxis: {
        },
        // 决定你展示什么样的图形图标
        series: {
            type: 'liquidFill',
            data: [0.60, 0.4, 0.2],//展示的数据
            waveAnimation: true,//动画
            animationDuration: 0,
            animationDurationUpdate: 0,
            radious: '100%',//半径
            outline: {
                show: true,
                borderDistance: 8,
                itemStyle: {
                    color: 'red',
                    borderColor: '#282952',
                    borderWidth: 8,
                    shadowBlur: 20,
                    shadowColor: 'rgba(0,0,0,0.25)'
                }
            }
        },
        // 布局组件
        grid: { left: 0, right: 0, top: 0, bottom: 0 }
    })
});
</script>
<style lang='scss' scoped>
* {
    color: white;
}

.box {
    background: url(../../images/dataScreen-main-lb.png) no-repeat;
    background-size: 100% 100%;
    margin-top: 10px;

    .top {
        .title {
            color: white;
            font-size: 20px;
        }

        .bg {
            width: 84px;
            height: 7px;
            background-size: 100% 100%;
            background: url(../../images/dataScreen-title.png) no-repeat;
            margin-top: 10px;
        }

        .deal {
            float: right;
            color: white;
            font-size: 20px;
            padding-right: 6px;

            span {
                color: orange;
            }
        }
    }

    .number {
        margin-top: 50px;
        display: flex;

        span {
            flex: 1;
            height: 40px;
            text-align: center;
            line-height: 40px;
            background: url(../../images/total.png) no-repeat;
            background-size: 100% 100%;
            color: #29fcff;
        }
    }

    .charts {
        width: 100%;
        height: 100%;
    }
}
</style>